package com.turtle.learning.contents.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 文章实体
 *
 * @author turtle
 * @since: 2020-05-06
 */
@Data
@Builder
public class ShareDTO {
    @ApiModelProperty(value = "发布人id", required = true)
    @NotNull(message = "发布人id不能为空")
    @Min(value = 1, message = "发布人id不能小于1")
    private Integer userId;

    @ApiModelProperty(value = "标题", required = true)
    @NotBlank(message = "标题不能为空")
    private String title;

    @ApiModelProperty(value = "是否原创 0:否 1:是", required = true)
    @Min(value = 0, message = "参数非法")
    @Max(value = 1, message = "参数非法")
    private Integer isOriginal;

    @ApiModelProperty(value = "作者", required = true)
    @NotBlank(message = "作者不能为空")
    private String author;

    @ApiModelProperty(value = "封面")
    private String cover;

    @ApiModelProperty(value = "概要信息", required = true)
    @NotBlank(message = "概要信息不能为空")
    private String summary;

    @ApiModelProperty(value = "价格（需要的积分）", required = true)
    private Integer price;

    @ApiModelProperty(value = "下载地址", required = true)
    @NotBlank(message = "下载地址不能为空")
    private String downloadUrl;
}
